package com.Listener;

import com.Util.PropertiesUtil;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * @description: 应用启动的全局监听器
 * @author: hkw14
 * @time: 2021/4/28 15:25
 */
@WebListener
public class AppListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        ServletContext servletContext = sce.getServletContext();
        servletContext.setAttribute("ctx", PropertiesUtil.getValue("web.properties","web_url"));
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {

    }
}
